package com.onenine.app.activity;

import android.support.v7.widget.RecyclerView;
import android.util.Pair;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.onenine.app.R;
import com.onenine.app.adapter.ReplyMsgAdapter;
import com.onenine.base.base.BasePageListActivity;
import com.onenine.base.view.PullRefreshRecyclerView;

import java.util.ArrayList;

/**
 * 消息-系统消息
 */
public class SystemMsgListActivity extends BasePageListActivity
        implements View.OnClickListener, BaseQuickAdapter.OnItemClickListener {

    @Override
    protected Pair<PullRefreshRecyclerView, RecyclerView.Adapter> initPullRefreshView() {
        return Pair.create(findViewById(R.id.pull_to_refresh_layout), new ReplyMsgAdapter());
    }

    @Override
    protected void initViews() {
        super.initViews();
        mPullRefreshView.setEnableLoadMore(false);
        mToolbar.setCenterTitle(R.string.system_msg);
        mToolbar.setRightTitle(R.string.clear_all);
    }

    @Override
    protected void initData() {
        super.initData();
        loadPageData(1);
    }

    @Override
    protected void initListeners() {
        super.initListeners();
        mToolbar.setOnRightClickListener(this);
        mPullRefreshView.setOnItemClickListener(this);
    }

    @Override
    protected void loadPageData(int pageNum) {
        dismissRefreshStatus();
        notifyDataSuccess(new ArrayList());
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_pull_refresh_layout;
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.tv_right_title) {
            onRefresh();
        }
    }

}
